test(query-devtools/Explorer): add tests for inline edit on primitive rows#10731
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
📝 WalkthroughWalkthroughA new ChangesInline edit behavior tests
Possibly related PRs
Suggested labels
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Comment |
|
View your CI Pipeline Execution ↗ for commit 5a479f9
☁️ Nx Cloud last updated this comment at |
🚀 Changeset Version PreviewNo changeset entries found. Merging this PR will not cause a version bump for any packages. |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@packages/query-devtools/src/__tests__/Explorer.test.tsx`:
- Around line 353-372: The test "should write the new number value via
\"setQueryData\" when a number input is changed" is missing the valueAsNumber
property in the synthetic change event; update the fireEvent.change call in
Explorer.test.tsx so the event target includes both value and valueAsNumber
(e.g., target: { value: '42', valueAsNumber: 42 }) because Explorer reads
changeEvent.target.valueAsNumber (see Explorer.tsx where the number input
handler uses valueAsNumber).
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro
Run ID: 9f7e0d91-59ea-4b1e-a3a3-880854e5ed89
📒 Files selected for processing (1)
packages/query-devtools/src/__tests__/Explorer.test.tsx
size-limit report 📦
|
…change event payload
🎯 Changes
Extend
Explorer.test.tsxwith tests for the inline edit UI rendered on primitive rows wheneditableis enabled — theinputelement forstring/numbervalues, the inlineToggleValueButtonforboolean, and the inlineDeleteItemButtongated byitemsDeletable.Added cases (
inline edit, 4):should write the new string value via "setQueryData" when a text input is changed— covers theinput onChangepath that writes the rawtarget.valueforstring.should write the new number value via "setQueryData" when a number input is changed— covers thevalueAsNumberbranch for thenumbertype.should render "ToggleValueButton" inline for a boolean primitive row— locks thetype() === 'boolean'branch in the primitive row.should render "DeleteItemButton" inline when a primitive row has "itemsDeletable"— locks theeditable && itemsDeletable && activeQuery !== undefinedguard.✅ Checklist
pnpm run test:pr.🚀 Release Impact
Summary by CodeRabbit